import cv2
import numpy as np

img = cv2.imread('3/lena_color.jpg')

mask = np.random.randint(0, 256, img.shape, dtype=np.uint8)

encrypt_img = cv2.bitwise_xor(img, mask)

decrypt_img = cv2.bitwise_xor(encrypt_img, mask)

cv2.imshow('encrypt', encrypt_img)
cv2.imshow('decrypt', decrypt_img)

cv2.waitKey(0)
cv2.destroyAllWindows()